$(document).ready(function () {
	
	//$(".ajax").colorbox();

	$(".ajax").each(function( index, element ){
		var params = {};
		$element = $(element);
		var callback = $element.attr('callback');
		if ( callback )
		{
			params.onClosed = function(){ eval(callback+'();'); }
		}
		$element.colorbox( params );
	});

	
});

$(document).bind('cbox_complete', function(){
    if ( formProcessor )
    {
        formProcessor.onLoad();
    }
});

$(document).bind('cbox_cleanup', function(){
	$('.ckeditor').each(function(ind, element){
		$element = $(element);
		CKEDITOR.instances[$element.attr('name')].destroy();
	});
});